Telegram Group & Telegram Channel
👣 “Cheating the Reaper in Go” от Miguel Young

В этой подробной статье автор показывает, как «обмануть» сборщик мусора Go и создать свой собственный arena-аллокатор на чистом Go, получая существенный прирост производительности.

📌 Что внутри:
- Краткий обзор GC Go: как используются pointer bits и shapes для точного сбора мусора.

- Реализация простого bump-аллокатора Arena, сводящего Alloc к смещению указателя.

- Бенчмарки: до 2×–4× ускорения при малых аллокациях и почти 7× для массивов из 64 элементов ( arena – 7370 MB/s vs new – 2865 MB/s )
mcyoung.xyz
.

- Оптимизация через sync.Pool и финализаторы для повторного использования и ускоренного обнуления памяти.

- Безопасный метод Reset() для мгновенной очистки арены без дорогостоящего выделения заново.

Заготовка примитивного Realloc(), позволяющая расширять последние аллокации «на месте».

Полный код, подробное объяснение и советы по дальнейшим оптимизациям — по ссылке:
https://mcyoung.xyz/2025/04/21/go-arenas/

@golang_books
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/golang_books/969
Create:
Last Update:

👣 “Cheating the Reaper in Go” от Miguel Young

В этой подробной статье автор показывает, как «обмануть» сборщик мусора Go и создать свой собственный arena-аллокатор на чистом Go, получая существенный прирост производительности.

📌 Что внутри:
- Краткий обзор GC Go: как используются pointer bits и shapes для точного сбора мусора.

- Реализация простого bump-аллокатора Arena, сводящего Alloc к смещению указателя.

- Бенчмарки: до 2×–4× ускорения при малых аллокациях и почти 7× для массивов из 64 элементов ( arena – 7370 MB/s vs new – 2865 MB/s )
mcyoung.xyz
.

- Оптимизация через sync.Pool и финализаторы для повторного использования и ускоренного обнуления памяти.

- Безопасный метод Reset() для мгновенной очистки арены без дорогостоящего выделения заново.

Заготовка примитивного Realloc(), позволяющая расширять последние аллокации «на месте».

Полный код, подробное объяснение и советы по дальнейшим оптимизациям — по ссылке:
https://mcyoung.xyz/2025/04/21/go-arenas/

@golang_books

BY Golang Books




Share with your friend now:
tg-me.com/golang_books/969

View MORE
Open in Telegram


Golang Books Telegram | DID YOU KNOW?

Date: |

Look for Channels Online

You guessed it – the internet is your friend. A good place to start looking for Telegram channels is Reddit. This is one of the biggest sites on the internet, with millions of communities, including those from Telegram.Then, you can search one of the many dedicated websites for Telegram channel searching. One of them is telegram-group.com. This website has many categories and a really simple user interface. Another great site is telegram channels.me. It has even more channels than the previous one, and an even better user experience.These are just some of the many available websites. You can look them up online if you’re not satisfied with these two. All of these sites list only public channels. If you want to join a private channel, you’ll have to ask one of its members to invite you.

Tata Power whose core business is to generate, transmit and distribute electricity has made no money to investors in the last one decade. That is a big blunder considering it is one of the largest power generation companies in the country. One of the reasons is the company's huge debt levels which stood at ₹43,559 crore at the end of March 2021 compared to the company’s market capitalisation of ₹44,447 crore.

Golang Books from hk


Telegram Golang Books
FROM USA